/*
 * @Descripttion:
 * @version: 1.0.0
 * @Author: YinJianFeng
 * @Date: 2024-03-29 15:57:55
 */
import { http } from '@amcax/base';

export const httpApi = {
  // 构件库
  getComponentCategories: async () =>
    http.get(`/api/v1/cad/components/categories`),
  getComponents: (data: any) =>
    http.get(`/api/v1/cad/components`, { params: data }),
  createComponent: (data: any) => http.post(`/api/v1/cad/components`, data),
  updateComponent: (data: any) =>
    http.put(`/api/v1/cad/component/${data.uuid}`, data),
  deleteComponent: (uuid: string) =>
    http.delete(`/api/v1/cad/component/${uuid}`),
  checkComponentName: (data: any) =>
    http.post(`/api/v1/cad/components/checkName`, data),
  genComponentName: (uuid: string) =>
    http.post(`/api/v1/cad/components/genName`, { projectUUID: uuid }),
};
